//
//  ByClassCollectionViewCell.m
//  LiangYa_BObject
//
//  Created by dllo on 15/10/29.
//  Copyright © 2015年 YuHao. All rights reserved.
//

#import "ByClassCollectionViewCell.h"

@implementation ByClassCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.imageV = [[UIImageView alloc] init];
        [self addSubview:_imageV];
        
        self.name = [[NightLabel alloc] init];
        _name.font = [UIFont systemFontOfSize:14];
        _name.textAlignment = NSTextAlignmentCenter;
        [self addSubview:_name];
    }
    return self;
}

- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
{
    [super applyLayoutAttributes:layoutAttributes];
    
    _imageV.frame = CGRectMake(3, 0, cellWidth - 6, cellHeight - 20);
    _name.frame = CGRectMake(0, cellHeight - 20, cellWidth, 20);
    if ([[NSUserDefaults standardUserDefaults]boolForKey:@"nightstyle"]) {
        _name.textColor = [UIColor whiteColor];
    }else{
        _name.textColor = [UIColor blackColor];
    }
    
}

- (void)awakeFromNib {
    // Initialization code
}

@end
